"""
校园圈子URL配置
定义帖子、评论、点赞等相关的API路由
"""

from django.urls import path
from . import views

app_name = 'circle'

urlpatterns = [
    # 分类和标签
    path('categories/', views.CategoryListView.as_view(), name='category_list'),
    path('tags/', views.TagListView.as_view(), name='tag_list'),
    
    # 帖子相关
    path('posts/', views.PostListView.as_view(), name='post_list'),
    path('posts/create/', views.PostCreateView.as_view(), name='post_create'),
    path('posts/<int:pk>/', views.PostDetailView.as_view(), name='post_detail'),
    path('posts/<int:pk>/update/', views.PostUpdateView.as_view(), name='post_update'),
    path('posts/<int:pk>/delete/', views.PostDeleteView.as_view(), name='post_delete'),
    path('posts/search/', views.PostSearchView.as_view(), name='post_search'),
    
    # 评论相关
    path('posts/<int:post_id>/comments/', views.CommentListView.as_view(), name='comment_list'),
    path('comments/<int:pk>/', views.CommentDetailView.as_view(), name='comment_detail'),
    
    # 点赞相关
    path('likes/', views.LikeView.as_view(), name='like'),
    
    # 用户相关
    path('users/<int:user_id>/posts/', views.user_posts_view, name='user_posts'),
    path('users/liked-posts/', views.user_liked_posts_view, name='user_liked_posts'),
]
